﻿using Wayloop.Blog.Core.Data.Entities;


namespace Wayloop.Blog.DataAccess.Mappings
{
    public class CommentMap : AbstractEntityMap<Comment>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="CommentMap"/> class.
        /// </summary>
        public CommentMap()
        {
            References(m => m.Post).ColumnName("PostId");

            Map(m => m.AuthorName);
            Map(m => m.AuthorWebsite);
            Map(m => m.Body);
            Map(m => m.CreatedOn);
            Map(m => m.Status).Not.Nullable().CustomTypeIs<CommentStatus>();
        }
    }
}